home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4943 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 64 6e | 73 2e 70 6c 61 6e 6f 2e |Path: dn|s.plano.|
|00000010| 6e 65 74 21 6e 65 77 73 | 09 0a 46 72 6f 6d 3a 20 |net!news|..From: |
|00000020| 43 68 61 72 6c 65 73 20 | 52 69 63 68 6d 6f 6e 64 |Charles |Richmond|
|00000030| 20 3c 72 69 63 68 6d 6f | 6e 64 40 70 6c 61 6e 6f | <richmo|nd@plano|
|00000040| 2e 6e 65 74 3e 0a 4e 65 | 77 73 67 72 6f 75 70 73 |.net>.Ne|wsgroups|
|00000050| 3a 20 63 6f 6d 70 2e 6c | 61 6e 67 2e 63 0a 53 75 |: comp.l|ang.c.Su|
|00000060| 62 6a 65 63 74 3a 20 52 | 65 3a 20 52 65 61 64 69 |bject: R|e: Readi|
|00000070| 6e 67 20 63 68 69 6c 64 | 20 70 67 6d 27 73 20 73 |ng child| pgm's s|
|00000080| 74 64 6f 75 74 3f 0a 44 | 61 74 65 3a 20 31 31 20 |tdout?.D|ate: 11 |
|00000090| 46 65 62 20 31 39 39 36 | 20 30 36 3a 34 32 3a 30 |Feb 1996| 06:42:0|
|000000a0| 33 20 47 4d 54 0a 4f 72 | 67 61 6e 69 7a 61 74 69 |3 GMT.Or|ganizati|
|000000b0| 6f 6e 3a 20 43 61 6e 69 | 6e 65 20 43 6f 6d 70 75 |on: Cani|ne Compu|
|000000c0| 74 65 72 20 43 65 6e 74 | 65 72 0a 4d 65 73 73 61 |ter Cent|er.Messa|
|000000d0| 67 65 2d 49 44 3a 20 3c | 34 66 6b 33 33 72 24 72 |ge-ID: <|4fk33r$r|
|000000e0| 61 71 40 64 6e 73 2e 70 | 6c 61 6e 6f 2e 6e 65 74 |aq@dns.p|lano.net|
|000000f0| 3e 0a 52 65 66 65 72 65 | 6e 63 65 73 3a 20 3c 63 |>.Refere|nces: <c|
|00000100| 6c 69 6e 74 44 4d 43 79 | 48 36 2e 4b 79 33 40 6e |lintDMCy|H6.Ky3@n|
|00000110| 65 74 63 6f 6d 2e 63 6f | 6d 3e 0a 4e 4e 54 50 2d |etcom.co|m>.NNTP-|
|00000120| 50 6f 73 74 69 6e 67 2d | 48 6f 73 74 3a 20 61 75 |Posting-|Host: au|
|00000130| 78 35 30 2e 70 6c 61 6e | 6f 2e 6e 65 74 0a 4d 69 |x50.plan|o.net.Mi|
|00000140| 6d 65 2d 56 65 72 73 69 | 6f 6e 3a 20 31 2e 30 0a |me-Versi|on: 1.0.|
|00000150| 43 6f 6e 74 65 6e 74 2d | 54 79 70 65 3a 20 74 65 |Content-|Type: te|
|00000160| 78 74 2f 70 6c 61 69 6e | 3b 20 63 68 61 72 73 65 |xt/plain|; charse|
|00000170| 74 3d 75 73 2d 61 73 63 | 69 69 0a 43 6f 6e 74 65 |t=us-asc|ii.Conte|
|00000180| 6e 74 2d 54 72 61 6e 73 | 66 65 72 2d 45 6e 63 6f |nt-Trans|fer-Enco|
|00000190| 64 69 6e 67 3a 20 37 62 | 69 74 0a 58 2d 4d 61 69 |ding: 7b|it.X-Mai|
|000001a0| 6c 65 72 3a 20 4d 6f 7a | 69 6c 6c 61 20 31 2e 31 |ler: Moz|illa 1.1|
|000001b0| 4e 20 28 4d 61 63 69 6e | 74 6f 73 68 3b 20 49 3b |N (Macin|tosh; I;|
|000001c0| 20 36 38 4b 29 0a 54 6f | 3a 20 63 6c 69 6e 74 40 | 68K).To|: clint@|
|000001d0| 6e 65 74 63 6f 6d 2e 63 | 6f 6d 0a 58 2d 55 52 4c |netcom.c|om.X-URL|
|000001e0| 3a 20 6e 65 77 73 3a 63 | 6c 69 6e 74 44 4d 43 79 |: news:c|lintDMCy|
|000001f0| 48 36 2e 4b 79 33 40 6e | 65 74 63 6f 6d 2e 63 6f |H6.Ky3@n|etcom.co|
|00000200| 6d 0a 0a 63 6c 69 6e 74 | 40 6e 65 74 63 6f 6d 2e |m..clint|@netcom.|
|00000210| 63 6f 6d 20 28 43 6c 69 | 6e 74 6f 6e 20 43 61 72 |com (Cli|nton Car|
|00000220| 72 29 20 77 72 6f 74 65 | 3a 0a 3e 43 61 6e 20 73 |r) wrote|:.>Can s|
|00000230| 6f 6d 65 6f 6e 65 20 70 | 72 6f 76 69 64 65 20 61 |omeone p|rovide a|
|00000240| 20 73 6e 69 70 70 65 74 | 20 6f 66 20 63 6f 64 65 | snippet| of code|
|00000250| 20 74 68 61 74 20 72 65 | 61 64 73 20 74 68 65 0a | that re|ads the.|
|00000260| 3e 73 74 64 6f 75 74 20 | 6f 66 20 61 20 63 68 69 |>stdout |of a chi|
|00000270| 6c 64 27 73 20 70 72 6f | 67 72 61 6d 3f 20 20 49 |ld's pro|gram? I|
|00000280| 66 20 49 20 75 73 65 20 | 50 65 72 6c 2c 20 74 68 |f I use |Perl, th|
|00000290| 65 6e 20 74 68 65 0a 3e | 66 6f 6c 6c 6f 77 69 6e |en the.>|followin|
|000002a0| 67 20 73 74 61 74 65 6d | 65 6e 74 20 64 6f 65 73 |g statem|ent does|
|000002b0| 20 69 74 20 66 6f 72 20 | 6d 65 2e 0a 3e 0a 3e 24 | it for |me..>.>$|
|000002c0| 61 6e 73 77 65 72 20 3d | 20 73 79 73 74 65 6d 28 |answer =| system(|
|000002d0| 22 2f 75 73 72 2f 6c 6f | 63 61 6c 2f 62 69 6e 2f |"/usr/lo|cal/bin/|
|000002e0| 63 68 69 6c 64 70 67 6d | 2e 70 6c 22 29 3b 0a 3e |childpgm|.pl");.>|
|000002f0| 0a 43 68 65 63 6b 20 74 | 68 65 20 6d 61 6e 20 70 |.Check t|he man p|
|00000300| 61 67 65 20 66 6f 72 20 | 61 20 66 75 6e 63 74 69 |age for |a functi|
|00000310| 6f 6e 20 63 61 6c 6c 65 | 64 20 70 6f 70 65 6e 28 |on calle|d popen(|
|00000320| 29 2e 20 49 74 20 61 6c | 6c 6f 77 73 20 79 6f 75 |). It al|lows you|
|00000330| 20 74 6f 20 72 75 6e 20 | 0a 61 6e 6f 74 68 65 72 | to run |.another|
|00000340| 20 70 72 6f 67 72 61 6d | 20 61 6e 64 20 72 65 61 | program| and rea|
|00000350| 64 20 74 68 65 20 73 74 | 64 6f 75 74 20 6f 66 20 |d the st|dout of |
|00000360| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 76 69 61 20 |the prog|ram via |
|00000370| 61 20 70 69 70 65 2e 20 | 0a 41 6c 74 65 72 6e 61 |a pipe. |.Alterna|
|00000380| 74 65 6c 79 2c 20 79 6f | 75 20 63 61 6e 20 6c 61 |tely, yo|u can la|
|00000390| 75 6e 63 68 20 74 68 65 | 20 6f 74 68 65 72 20 70 |unch the| other p|
|000003a0| 72 6f 67 72 61 6d 20 61 | 6e 64 20 77 72 69 74 65 |rogram a|nd write|
|000003b0| 20 74 6f 20 74 68 65 20 | 6f 74 68 65 72 20 0a 70 | to the |other .p|
|000003c0| 72 6f 67 72 61 6d 27 73 | 20 73 74 64 69 6e 20 69 |rogram's| stdin i|
|000003d0| 6e 73 74 65 61 64 2e 20 | 59 6f 75 20 63 61 6e 20 |nstead. |You can |
|000003e0| 64 6f 20 6f 6e 65 20 6f | 72 20 74 68 65 20 6f 74 |do one o|r the ot|
|000003f0| 68 65 72 2d 2d 2a 6e 6f | 74 2a 20 62 6f 74 68 2d |her--*no|t* both-|
|00000400| 2d 69 6e 20 6f 6e 65 20 | 0a 63 61 6c 6c 20 6f 66 |-in one |.call of|
|00000410| 20 70 6f 70 65 6e 28 29 | 2e 0a 0a 49 20 62 65 6c | popen()|...I bel|
|00000420| 69 65 76 65 20 70 6f 70 | 65 6e 28 29 20 72 65 74 |ieve pop|en() ret|
|00000430| 75 72 6e 73 20 61 20 66 | 69 6c 65 20 64 65 73 63 |urns a f|ile desc|
|00000440| 72 69 70 74 6f 72 20 74 | 68 61 74 20 79 6f 75 20 |riptor t|hat you |
|00000450| 75 73 65 20 77 69 74 68 | 20 72 65 61 64 28 29 20 |use with| read() |
|00000460| 74 6f 20 0a 67 65 74 20 | 74 68 65 20 72 65 73 75 |to .get |the resu|
|00000470| 6c 74 20 6f 66 20 74 68 | 65 20 63 68 69 6c 64 20 |lt of th|e child |
|00000480| 70 72 6f 63 65 73 73 27 | 20 73 74 61 6e 64 61 72 |process'| standar|
|00000490| 64 20 6f 75 74 2e 0a 0a | 0a |d out...|. |
+--------+-------------------------+-------------------------+--------+--------+